import 'package:ddlmanager/backend/ddl.dart';

class DDLlist {
  DDLlist({required this.ddlList});

  List<DDL> ddlList;

  // 将 DDLlist 对象转换为可序列化的 Map
  Map<String, dynamic> toJson() {
    return {'ddlList': ddlList.map((ddl) => ddl.toJson()).toList()};
  }

  // 从 Map 创建 DDLlist 对象
  factory DDLlist.fromJson(Map<String, dynamic> json) {
    return DDLlist(
      ddlList:
          (json['ddlList'] as List<dynamic>)
              .map((item) => DDL.fromJson(item))
              .toList(),
    );
  }
}
